package com.grt192.macro;

import com.grt192.core.GRTObject;
import com.grt192.core.controller.Macro;
import com.grt192.networking.spot.GRTServant;
import com.grt192.networking.spot.OutRadio;
import com.grt192.prototyper.PrototyperUtils;
import com.grt192.utils.Util;

public class ServentWriteDemo extends GRTObject implements Macro {

	public ServentWriteDemo() {
		setPrinting(true);
	}

	public int execute() {

		log("initializing...");
		GRTServant s = new GRTServant(99);
		OutRadio out = s.getServentOut(PrototyperUtils.getAddress(80));

		int x = 0;

		while (true) {
			String send = "Writer writing: " + x + "\t" + Util.random();
			log(send);
			out.sendData(send);
			x++;
			Util.sleep(10);
		}
	}
}
